<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>CSS3-伸缩布局详解</title>
    <style>
        body{
            margin: 0;
            padding: 0;
            font-family: '微软雅黑';
            background-color: #f7f7f7;
        }
        ul{
            margin: 0;
            padding: 0;
            list-style: none;
        }
        .wrapper{
            width: 1024px;
            margin: 0 auto;
        }
        .wrapper > section{
            min-height: 300px;
            margin-bottom: 30px;
            box-shadow: 1px 1px 4px #DDD;
            background-color: #fff;
        }
        .wrapper > header{
            text-align: center;
            line-height: 1;
            padding: 20px;
            margin-bottom: 10px;
            font-size: 30px;
        }
        .wrapper section > header{
            line-height: 1;
            padding: 10px;
            font-size: 22px;
            color: #333;
            background-color: #EEE;
        }
        .wrapper .wrap-box{
            padding: 20px;
        }
        .wrapper .brief {
            min-height: auto;
        }
        /*全局设置*/
        section ul{
            display: flex
        }

        section li{
            width: 200px;
            height: 200px;
            text-align: center;
            line-height: 200px;
            margin: 10px;
            background-color: pink;
        }
        .flex121 li:nth-child(1){
            flex: 1;
        }
        .flex121 li:nth-child(2){
            flex: 2;
        }
        .flex121 li:nth-child(3){
            flex: 1;
        }
        .flex121 li:nth-child(4){
            width: 600px;
        }

        /*分配的是哪部分空间：分配的是父盒子剩余的空间*/


    </style>
</head>
<body>
    <div class="wrapper">
        <header>CSS3-伸缩布局详解</header>
        <section class="brief">
            <header>flex</header>
            <div class="wrap-box">
                <p>控制子元素伸缩比例</p>
            </div>
        </section>
        <section class="flex121">
            <header>flex121</header>
            <div class="wrap-box">
               <ul>
                   <li>1</li>
                   <li>2</li>
                   <li>3</li>
                   <li>4</li>
               </ul>
            </div>

        </section>

    </div>
</body>
</html>